from django.db import models


# Create your models here.


class BlockInfo(models.Model):
    IS_ACTIVE = (
        (0, '未激活'),
        (1, '已激活')
    )
    block_name = models.CharField(max_length=20, unique=True, null=False, verbose_name='区组名称')
    block_code = models.CharField(max_length=68, unique=True, null=False, verbose_name='区组编号')
    business_code = models.IntegerField(unique=False, null=False, verbose_name='商户编号')
    is_active = models.SmallIntegerField(choices=IS_ACTIVE, unique=False, null=False, default=1, verbose_name='激活状态')
    created_time = models.DateTimeField(unique=False, null=False, verbose_name='创建时间')
    updated_time = models.DateTimeField(unique=False, null=False, verbose_name='更新时间')

    class Meta:
        db_table = 'block_info'
        verbose_name = '游戏区组信息'
        verbose_name_plural = verbose_name


class CardInfo(models.Model):
    IS_ACTIVE = (
        (0, '未激活'),
        (1, '已激活')
    )
    IS_SALE = (
        (-1, '已下架'),
        (0, '待售'),
        (1, '已售')
    )
    card_code = models.CharField(max_length=68, unique=True, null=False, verbose_name='卡片编号')
    block_code = models.CharField(max_length=68, unique=False, null=False, verbose_name='区组编号')
    business_code = models.IntegerField(unique=False, null=False, verbose_name='商户编号')
    card_pass = models.CharField(max_length=68, unique=False, null=False, verbose_name='卡密')
    card_desc = models.CharField(max_length=100, unique=False, null=False, verbose_name='奖品内容')
    sale_status = models.SmallIntegerField(choices=IS_SALE, unique=False, null=False, default=0, verbose_name='销售状态')
    is_active = models.SmallIntegerField(choices=IS_ACTIVE, unique=False, null=False, default=0, verbose_name='激活状态')
    push_sort = models.IntegerField(unique=False, null=False, default=9999999999, verbose_name='出卡顺序值')
    sale_time = models.DateTimeField(unique=False, null=False, verbose_name='售出时间')
    active_time = models.DateTimeField(unique=False, null=False, verbose_name='激活时间')
    created_time = models.DateTimeField(unique=False, null=False, verbose_name='创建时间')
    updated_time = models.DateTimeField(unique=False, null=False, verbose_name='更新时间')

    class Meta:
        db_table = 'card_info'
        verbose_name = '游戏卡信息'
        verbose_name_plural = verbose_name
